package com.fanrui.code.mahjong.util;

import com.fanrui.proto.cmd.JingTotal;
import com.fanrui.proto.cmd.WannengType;

public class Jing {
	
	/**
	 * 精类型
	 */
	private WannengType type;
	
	/**
	 * 个数
	 */
	private int number;
	
	/**
	 * 精分
	 */
	private int total;
	
	public Jing(WannengType type, int number, int total) {
		super();
		this.type = type;
		this.number = number;
		this.total = total;
	}

	public WannengType getType() {
		return type;
	}

	public void setType(WannengType type) {
		this.type = type;
	}

	public int getNumber() {
		return number;
	}

	public void setNumber(int number) {
		this.number = number;
	}

	public int getTotal() {
		return total;
	}

	public void setTotal(int total) {
		this.total = total;
	}
	
	public void addTotal(int total) {
		this.total += total;
	}

	public JingTotal toCmd() {
		JingTotal.Builder result = JingTotal.newBuilder();
		result.setType(type);
		result.setNumber(number);
		result.setTotal(total);
		return result.build();
	}
}
